package com.sheepone.util.algorithm.math;

/**
 * @author Miss.杨
 * @description
 * @since 2024/3/14 - 14:00
 */
public class TriangleUtil {

    /**
     * 计算三角形的度
     * @param adjacentEdge1 邻边长度1
     * @param adjacentEdge2 邻边长度2
     * @param oppositeEdge 对边长度
     * @return 角度
     */
    public static double getDegree(double adjacentEdge1, double adjacentEdge2, double oppositeEdge) {
        return Math.toDegrees(Math.acos((adjacentEdge1 * adjacentEdge1 + adjacentEdge2 * adjacentEdge2 - oppositeEdge * oppositeEdge)/(2 * adjacentEdge1 * adjacentEdge2)));
    }


}
